import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

public class Score {
    public static void main(String[] args) {
        System.out.println("  ====成绩统计====");
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入逗号分隔的多个成绩分数(最多1位小数):");
        String str = sc.next();
        String[] strArray = str.split(",");
        Double[] doubleArray = new Double[strArray.length];
        for(int i=0;i< strArray.length;i++) {
            doubleArray[i] = new Double(strArray[i]);
        }
        Arrays.sort(doubleArray, Collections.reverseOrder());
        System.out.println("按从大到小（降序）排序后的数据：");
        for(int i=0;i<doubleArray.length;i++) {
            System.out.printf("%.1f ",doubleArray[i]);
        }
        System.out.println("\n最高分：" + max(doubleArray));
        System.out.println("最低分：" + min(doubleArray));
        System.out.printf("平均分：%.2f",average(doubleArray));
    }
    public static double max(Double[] doubleArray) {
        double max = doubleArray[0];
        for(int i = 0;i< doubleArray.length;i++) {
            if(doubleArray[i] > max) {
                max = doubleArray[i];
            }
        }
        return max;
    }

    public static double min(Double[] doubleArray) {
        double min = doubleArray[0];
        for(int i = 0;i< doubleArray.length;i++) {
            if(doubleArray[i] < min) {
                min = doubleArray[i];
            }
        }
        return min;
    }
    public static double average(Double[] doubleArray) {
        double sum = 0;
        for(int i = 0;i< doubleArray.length;i++) {
            sum+=doubleArray[i];
        }
        return (sum/ doubleArray.length);
    }
}
